<div class="col-md-9 order_placed">
    <div class="page-header">
        <h2><?php echo lang('order_number');?>: <?php echo $order_id;?></h2>
    </div>
    <?php
    // content defined in canned messages
    echo $download_section;
    ?>
    <div class="row">
<?php /*        <div class="span4">
        	<?php print_r($customer)?>
            <h3><?php echo lang('account_information');?></h3>
            <?php echo (!empty($customer['company']))?$customer['company'].'<br/>':'';?>
            <?php echo $customer['firstname'];?> <?php echo $customer['lastname'];?><br/>
            <?php echo $customer['email'];?> <br/>
            <?php echo $customer['phone'];?>
        </div>*/?>
        <?php
        	$ship = $customer['ship_address'];
			$ship["area_code"] = $ship["area"];
        	$bill = $customer['bill_address'];
			$bill["area_code"] = $bill["area"];
        ?>
        <div class="span4">
            <h3><?php echo ($ship != $bill)?lang('shipping_information'):lang('shipping_and_billing');?></h3>
            <?php echo format_address($ship, TRUE);?><br/>
            
            <strong>Email</strong>: <?php echo $ship['email'];?><br/>
            <strong>Số điện thoại</strong>: <?php echo $ship['phone'];?>
        </div>
        <?php if($ship != $bill):?>
        <div class="span4">
            <h3><?php echo lang('billing_information');?></h3>
            
            <?php echo format_address($bill, TRUE);?><br/>
           <strong>Email</strong>: <?php echo $bill['email'];?><br/>
           <strong>Số điện thoại</strong>: <?php echo $bill['phone'];?>
        </div>
        <?php endif;?>
    </div>
    <?php if(!empty($shipping_notes) || !empty( $shipping['method']) || !empty($payment['description'])){?>
    <div class="row">
    	<?php if(!empty($shipping_notes)):?>
        <div class="span4">
            <h3><?php echo lang('additional_details');?></h3>
            <?php
            if(!empty($referral)):?><div><strong><?php echo lang('heard_about');?></strong> <?php echo $referral;?></div><?php endif;?>
            <div><strong><?php echo lang('shipping_instructions');?></strong> <?php echo $shipping_notes;?></div>
        </div>
        <?php endif;?>
        <?php if(!empty( $shipping['method'])){?>
        <div class="span4">
            <h3 style="padding-top:10px;"><?php echo lang('shipping_method');?></h3>
            <?php echo $shipping['method']; ?>
        </div>
        <?php }?>
        <?php if(!empty($payment['description'])){?>
        <div class="span4">
            <h3><?php echo lang('payment_information');?></h3>
            <p> <?php echo $payment['description']; ?></p>
            <div> <?php echo @$payment['content']?></div>
        </div>
        <?php }?>
         <?php if(!empty($go_cart["shipping_location"])){?>
             <div class="span4" style="border-top:1px dashed #666;padding-top:15px">
            	
               <strong>Phí vận chuyển <?php echo "(".!empty($go_cart["order_weight"])?$go_cart["order_weight"]:(0)." g)"?>():</strong> <?php echo format_currency($go_cart["shipping_location"]["total_price_shipping"])?>
          </div>
          <?php }?>
    </div>
    <?php }?>
    <?php if(empty($this->customer['id'])){
		$percent = array(8,20,10,10,15);
	}else{
		$percent = array(10,25,18,17,18);	
	}
	?>
    <?php if(!empty($note)){?>
    <div class="">
    	<h3> Ghi chú khách hàng</h3>
        <div class="">
        	<?php echo $go_cart["note"]?>
        </div>
    </div>
    <?php }?>
    <table class="table table-bordered table-striped" style="margin-top:20px;">
        <thead>
        	<tr>
				<th style="width:<?php echo $percent[0]?>%;"><?php echo lang('sku');?></th>
				<th style="width:<?php echo $percent[1]?>%;"><?php echo lang('name');?></th>
				<th style="width:<?php echo $percent[2]?>%;"><?php echo lang('price');?></th>
                <?php if(empty($this->customer['id'])){?> <th><?php echo lang('description');?></th><?php }?>
				<th style="width:<?php echo $percent[3]?>%;"><?php echo lang('quantity');?></th>
				<?php if(!empty($this->customer['id'])){?><th><?php echo 'Điểm' //echo lang('description');?></th><?php }?>
                <th style="width:<?php echo $percent[4]?>%;"><?php echo lang('totals');?></th>
			</tr>
        </thead>
        
        <tfoot>
            <?php if($go_cart['group_discount'] > 0)  : ?> 
            <tr>
                <td colspan="5"><strong><?php echo lang('group_discount');?></strong></td>
                <td align="right"><?php echo format_currency(0-$go_cart['group_discount']); ?></td>
            </tr>
            <?php endif; ?>
    
            <tr>
                <td colspan="5"><strong><?php echo lang('subtotal');?></strong></td>
                <td align="right"><?php echo format_currency($go_cart['subtotal']); ?></td>
            </tr>
            
            <?php if($go_cart['coupon_discount'] > 0)  : ?> 
                <tr>
                    <td colspan="5"><strong><?php echo lang('coupon_discount');?></strong></td>
                    <td align="right"><?php echo format_currency(0-$go_cart['coupon_discount']); ?></td>
                </tr>
				<?php if($go_cart['order_tax'] != 0) : // Only show a discount subtotal if we still have taxes to add (to show what the tax is calculated from) ?> 
                <tr>
                    <td colspan="5"><strong><?php echo lang('discounted_subtotal');?></strong></td>
                    <td align="right"><?php echo format_currency($go_cart['discounted_subtotal']); ?></td>
                </tr>
                <?php endif; ?>
            <?php endif; ?>
			<?php if($this->go_cart->total_score_minus_discount() != 0):?>
                <tr>
                    <td colspan="5"><strong>Số điểm bị trừ <?php echo $this->go_cart->total_score_minus_discount() ?> điểm </strong></td>
                    <td align="right">-<?php echo format_currency($this->go_cart->total_price_score()); ?></td>
                </tr>
			<?php endif;?>
            <?php // Show shipping cost if added before taxes
            if($this->config->item('tax_shipping') && $go_cart['shipping_cost']>0) : ?>
            <tr>
                <td colspan="5"><strong><?php echo lang('shipping');?></strong></td>
                <td align="right"><?php echo format_currency($go_cart['shipping_cost']); ?></td>
            </tr>
            <?php endif ?>
            
            <?php if($go_cart['order_tax'] != 0) : ?> 
            <tr>
                <td colspan="5"><strong><?php echo lang('taxes');?></strong></td>
                <td align="right"><?php echo format_currency($go_cart['order_tax']); ?></td>
            </tr>
            <?php endif;?>
            
            <?php // Show shipping cost if added after taxes
            if(!$this->config->item('tax_shipping') && $go_cart['shipping_cost']>0) : ?>
            <tr>
                <td colspan="5"><strong><?php echo lang('shipping');?></strong></td>
                <td align="right"><?php echo format_currency($go_cart['shipping_cost']); ?></td>
            </tr>
            <?php endif;?>
            
            <?php if($go_cart['gift_card_discount'] != 0) : ?> 
            <tr>
                <td colspan="5"><strong><?php echo lang('gift_card');?></strong></td>
                <td align="right"><?php echo format_currency(0-$go_cart['gift_card_discount']); ?></td>
            </tr>
            <?php endif;?>
            <?php if(!empty($go_cart["shipping_location"])){?>
            <tr>
            	<td colspan="5"> <strong>Phí vận chuyển: </strong> </td>
                <td align="right"> <?php echo format_currency($go_cart["shipping_location"]["total_price_shipping"])?> </td>
            </tr>
            <?php }?>
            <tr> 
                <td colspan="5"><strong><?php echo lang('grand_total');?></strong></td>
                <td align="right"><?php echo format_currency($go_cart['total']); ?></td>
            </tr>
        </tfoot>
    
        <tbody>
        <?php
        $subtotal = 0;
        foreach ($go_cart['contents'] as $cartkey=>$product):?>
            <tr>
                <td><?php echo $product['sku'];?></td>
                <td><?php echo $product['name']; ?></td>
                <td><?php echo format_currency($product['base_price']);?></td>
                <?php if(empty($this->customer['id'])){?> 	
                <td><?php echo $product['excerpt'];
                    if(isset($product['options'])) {
                        foreach ($product['options'] as $name=>$value)
                        {
                            if(is_array($value))
                            {
                                echo '<div><span class="gc_option_name">'.$name.':</span><br/>';
                                foreach($value as $item)
                                    echo '- '.$item.'<br/>';
                                echo '</div>';
                            } 
                            else 
                            {
                                echo '<div><span class="gc_option_name">'.$name.':</span> '.$value.'</div>';
                            }
                        }
                    }
                    ?></td>
                <?php }?>
                <td><?php echo $product['quantity'];?></td>
                <?php if(!empty($this->customer['id'])){?>  <td><?php echo $product["total_score_product"]?></td><?php }?>
                <td align="right"><?php echo format_currency($product['price']*$product['quantity']); ?></td>
            </tr>
	        <?php endforeach; ?>
        </tbody>
    </table>
</div>